var fs = require("fs");
var path = require('path');
var crypto = require('crypto');
var private_key = fs.readFileSync(__dirname+'/ali_key/min_private.pem', 'utf-8');
var public_key = fs.readFileSync(__dirname+'/ali_key/min_public.pem', 'utf-8');
// public_key = insert_str(public_key, '\n', 64);
// public_key = '-----BEGIN PUBLIC KEY-----\n' + public_key + '-----END PUBLIC KEY-----';
// private_key = insert_str(private_key, '\n', 64);
// private_key = '-----BEGIN RSA PRIVATE KEY-----\n' + private_key + '-----END RSA PRIVATE KEY-----';
// function insert_str(str, insert_str, sn){
//     var newstr = "";
//     for (var i = 0; i < str.length; i += sn) {
//         var tmp = str.substring(i, i + sn);
//         newstr += tmp + insert_str;
//     }
//     return newstr;
// }
// console.log(private_key);
// let str11 = 'a=123';
// let signer = crypto.createSign('RSA-SHA256');
// signer.update(str11, 'utf8');
// let sign = signer.sign(private_key, 'base64');
// console.log(sign);
var alipay_config = {
   host:"openapi.alipay.com",
   port:'443',
   charset:"UTF-8",
   // 签名方式
   sign_type:"RSA2",
   //应用ID,您的APPID。
   app_id:"2017101609334098",
   //商户私钥
   merchant_private_key:private_key,
   // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
   alipay_public_key:public_key,  
   return_url:"http://sxzd365.com/zd/wxlogin_test.html",
   notify_url:"http://sxzd365.com/ali_notify_url",
   // 支付宝网关
   gatewayUrl:"https://openapi.alipay.com/gateway.do"
   
};
module.exports = alipay_config;
